/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import javax.swing.JLabel;
import javax.swing.JTextField;
import model.Document;
import model.NewsPaper;

/**
 *
 * @author Ira
 */
public class DocumentPropertiesNewsPaper extends DocumentPropertiesField {
	
	private JLabel lblDayDate = new JLabel("Dâte du jour");
	private JTextField txtDayDate = new JTextField(13);
	
	public DocumentPropertiesNewsPaper(boolean editable) {
		super(editable);
		
		this.txtDayDate.setEditable(editable);
		this.add(this.lblDayDate, "w 60!");
		this.add(this.txtDayDate);
	}

	@Override
	public void setContent(Document d) {
		this.txtDayDate.setText("" + ((NewsPaper)d).getDayDate());
	}

	@Override
	public void getContent(Document d) {
		NewsPaper np = (NewsPaper)d;
		np.setDayDate(this.txtDayDate.getText());
	}

	/**
	 * @return the txtDayDate
	 */
	public String getTxtDayDate() {
		return txtDayDate.getText();
	}
	
}
